import { observable, action } from 'mobx';
import motionCONST from 'common/const/observer/motion';
import { Base } from 'stores/models/core';


export default class Element extends Base {

  constructor(props, data) {
    super();

    const obData = {};
    motionCONST.forEach(item => {
      if (data[item.key]) {
        obData[item.key] = data[item.key];
      } else {
        obData[item.key] = item.val;
      }
    });

    this.init({
      props: {
        parent: props.parent,
        type: 'FrameElement',
        label: '帧元素',
        realId: data.realId,
        src: data.src
      },
      observableProps: {
        ...obData,
        lock: false,
        visible: true,
        ease: 'linear'
      }
    });
  }
}
